﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Mvc;

namespace EasySite.Web.Controllers
{
    public abstract class ControllerBase : Controller
    {
        protected string Username
        {
            get
            {
                if (Request.IsAuthenticated)
                {
                    return User.Identity.Name;
                }
                return null;
            }
        }

        protected T GetService<T>()
        {   
            return DependencyResolver.Current.GetService<T>();
        }
    }
}
